package com.way.repository;

import com.way.domain.entity.SysRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysRoleRepository extends JpaRepository<SysRole, Integer>, JpaSpecificationExecutor<SysRole> {

    @Query(value = "from SysRole where name like :name and isDeleted != 1")
    List<SysRole> findByName(@Param("name") String name);

    List<SysRole> findByNameLike(String name);

}
